// 1=》h5 2=》h5微信 3=》微信小程序
export default function (sync = false) {
    let ua = window.navigator.userAgent.toLowerCase();
    let sign = window ? 1 /* ENVTYPE.h5 */ : 0 /* ENVTYPE.other */;
    if (sign !== 0 /* ENVTYPE.other */ && /MicroMessenger/i.test(ua)) {
        wx.miniProgram.getEnv((res) => {
            sign = res.miniprogram ? 3 /* ENVTYPE.wxapp */ : 2 /* ENVTYPE.wx */;
        });
    }
    if (sync) {
        return sign;
    }
    else {
        return Promise.resolve(sign);
    }
}
